/**
 *  The purpose of this header file is to define all the dependecies hardware
 *  configuration.
 *
 */

#ifndef __AT644P_HARDWARE_H__
#define __AT644P_HARDWARE_H__

#include <avr/interrupt.h>
#include <avr/io.h>

#include <at644p/timer/at644p_timer1.h>

#define ENABLE_GLOBAL_ISR() sei()

// Bit operators using bit number
#define SET_BIT(port, bit)    ((port) |= _BV(bit))
#define CLR_BIT(port, bit)    ((port) &= ~_BV(bit))
#define READ_BIT(port, bit)   (((port) & _BV(bit)) != 0)
#define FLIP_BIT(port, bit)   ((port) ^= _BV(bit))
#define WRITE_BIT(port, bit, value) \
   if (value) SET_BIT((port), (bit)); \
   else CLR_BIT((port), (bit))

#define CLOCK_PULSE_PORT PORTD
#define CLOCK_PULSE_DIR  DDRD
#define CLOCK_PULSE_PIN  PD0


#endif
